package cooltcp;

import java.io.*;


public class SaveImage {
    
    File img_file = null;
    FileOutputStream fi = null;
    BufferedOutputStream bo = null;
    DataOutputStream ds= null;
 
    public SaveImage() throws IOException{
        
        img_file = new File("copy.avi"); //yes it will be hardcoded :)
        fi = new FileOutputStream(img_file); //put into the stream
        bo = new BufferedOutputStream(fi);
        ds= new DataOutputStream(bo); //you can write on that one
        
    }

    public void writeThatByte(byte[] byte_write,int MAX_IO_BUFFER) throws IOException{
       
        ds.write(byte_write,0,MAX_IO_BUFFER);

        }

    public void finishWriting() throws IOException{
            if(ds!=null)
                ds.close();
     
    }
}
